import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http{{importFileExtension}}';
import { Configuration{{^useInversify}}, ConfigurationOptions{{/useInversify}} } from '../configuration{{importFileExtension}}'
{{^useInversify}}
import type { Middleware } from '../middleware{{importFileExtension}}';
{{/useInversify}}
{{#useRxJS}}
import { Observable } from 'rxjs';
{{/useRxJS}}

{{#models}}
{{#model}}
import { {{{ classname }}} } from '{{{ importPath }}}{{importFileExtension}}';
{{/model}}
{{/models}}
{{#apiInfo}}
{{#apis}}

{{#operations}}
import { Observable{{classname}} } from "./ObservableAPI{{importFileExtension}}";
import { {{classname}}RequestFactory, {{classname}}ResponseProcessor} from "../apis/{{classname}}{{importFileExtension}}";

{{#operation}}
export interface {{classname}}{{operationIdCamelCase}}Request {
    {{#allParams}}
    /**
     * {{description}}
     {{#minimum}}
     * Minimum: {{minimum}}
     {{/minimum}}
     {{#maximum}}
     * Maximum: {{maximum}}
     {{/maximum}}
     {{#defaultValue}}
     * Defaults to: {{defaultValue}}
     {{/defaultValue}}
     * @type {{dataType}}
     * @memberof {{classname}}{{nickname}}
     */
    {{paramName}}{{^required}}?{{/required}}: {{{dataType}}}
    {{/allParams}}
}

{{/operation}}
export class Object{{classname}} {
    private api: Observable{{classname}}

    public constructor(configuration: Configuration, requestFactory?: {{classname}}RequestFactory, responseProcessor?: {{classname}}ResponseProcessor) {
        this.api = new Observable{{classname}}(configuration, requestFactory, responseProcessor);
    }

{{#operation}}
    /**
     {{#notes}}
     * {{&notes}}
     {{/notes}}
     {{#summary}}
     * {{&summary}}
     {{/summary}}
     * @param param the request object
     */
    public {{nickname}}WithHttpInfo(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify}}Options{{/useInversify}}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<HttpInfo<{{{returnType}}}{{^returnType}}void{{/returnType}}>> {
        return this.api.{{nickname}}WithHttpInfo({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}};
    }

    /**
     {{#notes}}
     * {{&notes}}
     {{/notes}}
     {{#summary}}
     * {{&summary}}
     {{/summary}}
     * @param param the request object
     */
    public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, options?: Configuration{{^useInversify}}Options{{/useInversify}}): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{{returnType}}}{{^returnType}}void{{/returnType}}> {
        return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}};
    }

{{/operation}}
}
{{/operations}}
{{/apis}}
{{/apiInfo}}
